package Gui;

import java.awt.Rectangle;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class StartForm extends JPanel
{
	private JButton stopButton = null;
	private JLabel workingLabel = null;
	private int port;
	
	/**
	 * This is the default constructor
	 */
	public StartForm(int port) 
	{
		super();
		this.port = port;
		initialize();	
	}
	
	/**
	 * This method initializes ProductForm
	 */
	private void initialize() 
	{	
		workingLabel  = new JLabel();
		workingLabel .setBounds(new Rectangle(30, 80, 270, 22));
		workingLabel .setText("Server listening for connections on port "+port);
				
		this.setSize(400, 300);
		this.setLayout(null);
		this.add(workingLabel,null);	
		this.add(getStopButton(),null);		
	}
	
	
	/**
	 * This method initializes SaveButton	
	 */
	private JButton getStopButton() 
	{
		if (stopButton == null) 
		{
			stopButton = new JButton();
			stopButton.setBounds(new Rectangle(20, 100, 172, 29));
			stopButton.setText("STOP");
			stopButton.addActionListener(new java.awt.event.ActionListener() 
			{
				public void actionPerformed(java.awt.event.ActionEvent e) 
				{
					System.exit(0);
				}					
			});						
		}
		return stopButton;
	}
	
}
